//
//  UIView+Additions.h
//  HTF_New
//
//  Created by lijinyang on 16/9/2.
//  Copyright © 2016年 htffund. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <WebKit/WebKit.h>
@interface UIView (Additions)
+(CGFloat)size_1px;
UIView * bgViewColorSeparateLine(CGRect frame);
UIView * separateLine(CGRect frame);
UIView * garySeparateLine(CGRect frame);
UIView * redSeparateLine(CGRect frame);
UIView * separateLineWithColor(CGRect frame,UIColor *lineColor);
UIView * drawDotLine(CGRect frame ,UIView* superView,UIColor *lineColor);
-(void)setBorderWithColor:(UIColor *)borderColor;
/**
 *  通过 CAShapeLayer 方式绘制虚线
 *
 *  param lineView:       需要绘制成虚线的view
 *  param lineLength:     虚线的宽度
 *  param lineSpacing:    虚线的间距
 *  param lineColor:      虚线的颜色
 *  param lineDirection   虚线的方向  YES 为水平方向， NO 为垂直方向
 **/
- (void)drawLineOfDashByCAShapeLayer:(UIView *)lineView lineLength:(int)lineLength lineSpacing:(int)lineSpacing lineColor:(UIColor *)lineColor lineDirection:(BOOL)isHorizonal;
/**
 *  把View转化为图片
 */
-(UIImage *)selfChangeToImage;

/**
 设置uiview圆角
 */
- (void)setCorners:(UIRectCorner)corners cornerRadius:(float)cornerRadius;

/**
 设置uiview圆角
 */
- (void)setAllCornersWithCornerRadius:(float)cornerRadius;

/**
 通过视图找到 nextResponder 为viewcontroller的responder
 */
-(UIViewController *)findViewControllerResponder;

/**
 添加阴影路径
 */
+(void)viewShadowPathWithView:(UIView*)view Color:(UIColor *)shadowColor shadowOpacity:(CGFloat)shadowOpacity shadowRadius:(CGFloat)shadowRadius shadowPathType:(NSInteger)shadowPathType shadowPathWidth:(CGFloat)shadowPathWidth;

/**
 设置渐变色
 startColor:开始颜色
 endColor:结束颜色
 horizonalDirection: yes 水平 no垂直
 @6.70
 */
-(void)setGriediantLayerWithStartColor:(UIColor *)startColor endColor:(UIColor *)endColor isHorizonalDirection:(BOOL)horizonalDirection;

#pragma mark 展示缺省页
-(void)showEmptyWithImage:(UIImage*)image text:(NSString*)text;

-(void)showEmptyWithFrame:(CGRect)rect
                    image:(UIImage *)emptyImage
                     text:(NSString *)emptyText
          backgroundColor:(UIColor *)color
             cornerRadius:(CGFloat)radius;

#pragma mark 关闭缺省页
-(void)dismissDefaultView;

/**
 截取view 转成image对象
 */
- (UIImage *)nomalSnapshotImage;

/**
 截取WKWebView长图
 */
+(UIImage *)convertWholePageToImage:(WKWebView *)wkweb;

/**
 通过视图 找到viewcontroller
 @7.20
 */
-(UIViewController*)findViewController;

/**
 是否通过视图 找到目标父类名
 @7.40
 */
-(UIView *)findTargetSuperViewClassName:(NSString *)className;


-(void)removeAllSubView;

@end
